package com.xxl.job.plus.executor.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import lombok.Data;

/**
 * @author : guorf
 * @version : v1.0
 * @description : TODO
 * @createTime : 2023/4/23 9:42
 */
@Data
@Component //注册bean到容器中
@ConfigurationProperties("xxl.job")
public class XxlJobProperties {

    /**
     * 认证信息
     */
    private AdminProperties admin;

    /**
     * token
     */
    private String accessToken;

    /**
     * 执行器信息
     */
    private ExecutorProperties executor;

    @Data
    public static class AdminProperties {

        private String addresses;
        private String username;
        private String password;

    }
    @Data
    public static class ExecutorProperties {

        private String appname;
        private String title;
        private String address;
        private String ip;
        private int port;
        private String logpath;
        private int logretentiondays;
        /*
         * 执行器地址类型：0=自动注册、1=手动录入
         * */
        private String addressType;
        /*
         * 执行器地址列表，多地址逗号分隔(手动录入)
         * */
        private String addressList;
    }
}